package com.sxf.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.sxf.dao.TermTaxonomyDAO;
import com.sxf.domain.blog.TermTaxonomy;
import com.sxf.domain.viewbean.TermTaxonomyVO;
import com.sxf.mybatis.page.Pagination;
import com.sxf.querybean.TermTaxonomyQuery;

@Repository("termTaxonomyDAO")
public class TermTaxonomyDAOImpl extends SuperDAOImpl implements TermTaxonomyDAO {
	
	
	private static final String STATEMENT_QUERY = "mybatis.xml.TermTaxonomy.query";

	@Override
	public Pagination<TermTaxonomyVO> queryPage(TermTaxonomyQuery query) {
		return queryPageTemplate(STATEMENT_QUERY, query);
	}

	@Override
	public TermTaxonomyVO queryOne(TermTaxonomyQuery query) {
		return queryOneTemplate(STATEMENT_QUERY, query);
	}

	@Override
	public List<TermTaxonomyVO> queryList(TermTaxonomyQuery query) {
		return queryListTemplate(STATEMENT_QUERY, query);
	}

	@Override
	public long queryNumber(TermTaxonomyQuery query) {
		return queryNumberTemplate(STATEMENT_QUERY, query);
	}
	
	
	@Override
	public int insert(TermTaxonomy info) {
		if (info != null) {
			int i = st.insert("mybatis.xml.TermTaxonomy.insertSelective", info);
			return i;
		}
		return 0;
	}

	@Override
	public int update(TermTaxonomy info) {
		if (info != null) {
			return st.update(
					"mybatis.xml.TermTaxonomy.updateByPrimaryKeySelective",
					info);
		}
		return 0;
	}

	@Override
	public int delete(TermTaxonomy info) {
		if (info != null) {
			return st.delete("mybatis.xml.TermTaxonomy.deleteByPrimaryKey",
					info);
		}
		return 0;
	}
}
